package com.example.module_home.paging

import androidx.lifecycle.ViewModel
import androidx.lifecycle.asLiveData
import androidx.lifecycle.viewModelScope
import androidx.paging.Pager
import androidx.paging.PagingConfig
import androidx.paging.cachedIn


class PageViewModel : ViewModel() {

    val articles = Pager(PagingConfig(20)) {
        ArticleDataSource()
    }.flow.cachedIn(viewModelScope).asLiveData()
}